import {system} from "../function_menu/dispatch";
let targetTracking = system("targetTracking", ["form", "search","setRole", "formGet"], {
  state: {
    idKey:"roleId",
    roleKey:"menuId",
    mapPowerList:{},
    vuexDepartmentSearchForm: null,
    vuexYearSearchForm: null,
    vuexMonthSearchForm: null,
    tabId_year: 1,
    tabId_month: 1,
  },
  mutations: {
    updateInfo(state, par) {
      if(par[1] instanceof Array){
        state[par[0]] = par[1];
      }else if(par[1] instanceof Object){
        state[par[0]] = Object.assign({}, state[par[0]]  , par[1]);
      }else{
        state[par[0]] =  par[1]
      }
      // console.log(par[1] instanceof Object)
    }
  }

})

export default targetTracking;